package b.p.b;

import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.j;
import androidx.recyclerview.widget.RecyclerView.z;
import b.p.b.q.d;
import b.p.b.q.f;
import c.h.a.n0.i.a;
import java.util.Objects;

/* compiled from: ItemTouchHelper */
public class r implements Runnable {
    public final /* synthetic */ f a;
    public final /* synthetic */ int b;
    public final /* synthetic */ q c;

    public r(q qVar, f fVar, int i) {
        this.c = qVar;
        this.a = fVar;
        this.b = i;
    }

    public void run() {
        RecyclerView recyclerView = this.c.r;
        if (recyclerView != null && recyclerView.isAttachedToWindow()) {
            f fVar = this.a;
            if (!fVar.k && fVar.e.e() != -1) {
                j itemAnimator = this.c.r.getItemAnimator();
                if (itemAnimator == null || !itemAnimator.g()) {
                    q qVar = this.c;
                    int size = qVar.p.size();
                    Object obj = null;
                    for (int i = 0; i < size; i++) {
                        if (!((f) qVar.p.get(i)).l) {
                            obj = 1;
                            break;
                        }
                    }
                    if (obj == null) {
                        d dVar = this.c.m;
                        z zVar = this.a.e;
                        Objects.requireNonNull((a) dVar);
                        return;
                    }
                }
                this.c.r.post(this);
            }
        }
    }
}
